package com.glsc.ngateway.common.base.domain.mysql.opmanagemain.outsys;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.DateSerializer;
import com.glsc.ngateway.common.api.common.enums.DictConstant;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.Where;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * @author liwei
 * 部门外部系统权限oa发生那个日志
 */
@Data
@Entity
@Table(name = "t_out_system_oa_log")
@org.hibernate.annotations.Table(appliesTo = "t_out_system_oa_log", comment = "部门外部系统权限oa发生那个日志")
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties({"hibernateLazyInitializer", "handler"})
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class OutSystemOaLog implements Serializable {
    private static final long serialVersionUID = -3722303081812247096L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    private Integer id;

    @Column(name = "status", columnDefinition = "varchar(100) COMMENT '状态 字典 yesno Y触发成功 N触发失败'")
    @ApiModelProperty(value = "状态 字典 yesno Y触发成功 N触发失败")
    private String status;

    @Column(name = "dept_name", columnDefinition = "varchar(100) COMMENT '部门名称'")
    @ApiModelProperty(value = "部门名称")
    private String deptName;

    @Column(name = "dept_id", columnDefinition = "INT COMMENT '部门id'")
    @ApiModelProperty(value = "部门id")
    private Integer deptId;

    @Column(name = "oa_flow_id", columnDefinition = "varchar(50) COMMENT '创建的oa流程的id'")
    @ApiModelProperty(value = "创建的oa流程的id")
    private String oaFlowId;

    @Column(name = "oa_flow_name", columnDefinition = "varchar(50) COMMENT 'oa流程name'")
    @ApiModelProperty(value = "oa流程name")
    private String oaFlowName;

    @Column(name = "memo", columnDefinition = "varchar(255) COMMENT '部门名称'")
    @ApiModelProperty(value = "备注")
    private String memo;

    @Column(name = "execute_day", columnDefinition = "varchar(255) COMMENT '执行日期'")
    @ApiModelProperty(value = "执行日期")
    private String executeDay;

    //创建时间
    @Column(name = "create_time", updatable = false)
    @org.hibernate.annotations.CreationTimestamp
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = DateSerializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建时间")
    private Date createTime;


}
